package com.wuhao.shootclient.util;

import java.text.DecimalFormat;
import java.text.NumberFormat;

/**
 * Create by hao on 2019-11-01
 */
public class StrUtil {


    public static int toInt(String num) {
        String intNumber = num.substring(0, num.indexOf("."));
        return Integer.valueOf(intNumber);
    }

//    public static int Format(float points){
//        NumberFormat nf = new DecimalFormat("#.##");
//        return Integer.valueOf(nf.format(points));
//    }

    public static int Format(float points){
        String floatString = String.valueOf(points);
        String substring = floatString.substring(0, floatString.indexOf("."));
        return Integer.valueOf(substring);
    }
}
